import javax.swing.*;

import java.awt.CardLayout;


public class MainFrame extends JFrame{
    
    CardLayout c = new CardLayout(0,0);
    
    JPanel admin = new AdminGUI();
    JPanel nurse = new NurseGUI();
    JPanel edit = new EditPatientGUI();
    LoginGUI login = new LoginGUI();
    DoctorGUI doctor = new DoctorGUI();
    DoctorsOrdersGUI Do = new DoctorsOrdersGUI();
    HealthHistoryGUI hh = new HealthHistoryGUI();
    
    
    
    
    public MainFrame() {
        
        getContentPane().setLayout(c);
        
        
        getContentPane().add("login", login);
        getContentPane().add("doctor", doctor);
        getContentPane().add("EditP", edit);
        getContentPane().add("Do", Do);
        getContentPane().add("hh", hh);
        int role = 0;
        
        
        
        
        
        
        
        //cards = new JPanel(cl);
        //cards.add(login);
        //cards.add(doctor);
        
        
        //cards.remove(login);
        
        //cl.show(cards, "doctor");
        
        

        
        
     
        //this.add(login);
        //this.add(nurse);
        //this.add(doctor);
        //this.add(admin);
        //this.add(edit);
        
    }
    public void changeScreen()
    {
       if (login.getRole() == 1 && doctor.getRole() == 0)
       {
       c.show(getContentPane(), "doctor");
       }
       
       if (doctor.getRole() == 2)
       {
       c.show(getContentPane(), "EditP");
       }
       
       if (doctor.getRole() == 2)
       {
       c.show(getContentPane(), "EditP");
       }
       
       if (doctor.getRole() == 3)
       {
       c.show(getContentPane(), "Do");
       }
       
       if (doctor.getRole() == 4)
       {
       c.show(getContentPane(), "hh");
       }
       
       
    }
    
    public LoginGUI getLogin()
    {
        return login;
    }
    
    public DoctorGUI getDoc()
    {
        return doctor;
    }
    

}
